function Show(id){
        var obj=document.getElementById('m_'+id);
        if(obj.style.display=="none"){
                obj.style.display="";
                //将子菜单Id放入Cookies
                var miceCMS_menu = readCookie('miceCMS_menu');
                if(miceCMS_menu!='')
                {
                    var arr_miceCMS_menu = miceCMS_menu.split(',');
                    var found = false;
                    for(i=0;i<arr_miceCMS_menu.length-1;i++)
                    {
                        if(arr_miceCMS_menu[i].toString()==id) {found=true;}
                    }
                    if(!found){writeCookie('miceCMS_menu',miceCMS_menu+','+id,12)}
                }
                else {
                    writeCookie('miceCMS_menu',id,12)
                }
                //将子菜单Id放入Cookies End
        }else{
                obj.style.display="none";
                //将子菜单Id从Cookies中移除
                var miceCMS_menu = readCookie('miceCMS_menu');
                if(miceCMS_menu!='')
                {
                    var arr_miceCMS_menu = miceCMS_menu.split(',');
                    for(i=0;i<arr_miceCMS_menu.length;i++)
                    {
                        if(arr_miceCMS_menu[i].toString()==id) {arr_miceCMS_menu=arr_miceCMS_menu.del(i--);}
                    }
                    miceCMS_menu = arr_miceCMS_menu.join(',');
                    //alert(miceCMS_menu);
                    writeCookie('miceCMS_menu',miceCMS_menu,12)
                }
                //将子菜单Id从Cookies中移除 End
        }

}

function readCookie(name)

{

  var cookieValue = "";

  var search = name + "=";

  if(document.cookie.length > 0)

  { 

    offset = document.cookie.indexOf(search);

    if (offset != -1)

    { 

      offset += search.length;

      end = document.cookie.indexOf(";", offset);

      if (end == -1) end = document.cookie.length;

      cookieValue = unescape(document.cookie.substring(offset, end))

    }

  }

  return cookieValue;

}

function writeCookie(name, value, hours)

{

  var expire = "";

  if(hours != null)

  {

    expire = new Date((new Date()).getTime() + hours * 3600000);

    expire = "; expires=" + expire.toGMTString();

  }

  document.cookie = name + "=" + escape(value) + expire;

}
Array.prototype.del=function(n) {  //n表示第几项，从0开始算起。
//prototype为对象原型，注意这里为对象增加自定义方法的方法。
  if(n<0)  //如果n<0，则不进行任何操作。
    return this;
  else
    return this.slice(0,n).concat(this.slice(n+1,this.length));
}


window.onload = function menuload()
{
    var miceCMS_menu = readCookie('miceCMS_menu');
    var totalShow = 2;    //自己修改一共有多少个二级分类
    if(miceCMS_menu!=''&&miceCMS_menu!=null)
    {
        for(i=1;i<=totalShow;i++)
        {
            document.getElementById('m_'+i).display="none";
        }
        var arr_miceCMS_menu;
        arr_miceCMS_menu = miceCMS_menu.split(',');
        for(i=0;i<=arr_miceCMS_menu.length-1;i++)
        {
            if(arr_miceCMS_menu[i]!=''){document.getElementById('m_'+arr_miceCMS_menu[i]).style.display="";}
        }

    }
}